/*
package org.itboys.mobile.service.mongo.web;

import org.itboys.admin.service.lasted.SundayUploadService;
import org.itboys.commons.utils.tools.ListUtil;
import org.itboys.commons.utils.tools.LongUtil;
import org.itboys.mobile.common.SundayCommonConstants;
import org.itboys.mobile.entity.mongo.SundayFloorMr;
import org.itboys.mobile.entity.mongo.SundayFloorMrGroup;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.itboys.param.PageResult;
import org.itboys.param.ParamUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

*/
/**
 * @Author：贾琦磊
 * @Date：2018/7/17
 * @Description：
 * 废除--2018年8月3日14:52:53
 *//*

@Service
public class SundayFloorMrService extends BaseMongoService<SundayFloorMr>{
    @Resource(name = "mobileDs")
    private MongoDataSource dataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return dataSource;
    }
    @Override
    protected Class<SundayFloorMr> getEntityClass() {
        return SundayFloorMr.class;
    }
    @Autowired
    private SundayUploadService uploadService;

    @Autowired
    private SundayFloorMrGroupService groupService;

    */
/**
     * 新增或是修改
     * @param id
     * @param question
     * @param answer
     * @throws IOException
     *//*

    public void save(Long id,String question,String answer,Long titleId) throws IOException {
        SundayFloorMr floorMr=new SundayFloorMr(question,answer,titleId);
        if(LongUtil.isNotZreo(id)){
            super.updateExceptEmpty(id,floorMr);
        }else {
            super.save(floorMr);
        }
    }

    */
/**
     * 分页查询楼先生问题
     * @param request
     * @return
     *//*

    public PageResult<SundayFloorMr> select(HttpServletRequest request){
        Map<String, Object> param = ParamUtil.packageMongoExactParam(request,"titleId");
        param.put("isDeleted", SundayCommonConstants.NO);
        PageResult<SundayFloorMr> floorMrPageResult = super.containpageQuery(request, null, param);
        List<SundayFloorMr> data = floorMrPageResult.getData();
        if(ListUtil.isNull(data)){
            return floorMrPageResult;
        }
        List<Long> groupIds=new ArrayList<>();
        for (SundayFloorMr floorMr:data) {
            groupIds.add(floorMr.getTitleId());
        }
        param.clear();
        param.put("isDeleted",SundayCommonConstants.NO);
        param.put("id in",groupIds);
        List<SundayFloorMrGroup> groups = groupService.list(param);
        for (SundayFloorMr floorMr:data) {
            for (SundayFloorMrGroup group:groups) {
                if(group.getId()==floorMr.getTitleId().longValue()){
                    floorMr.setTitleName(group.getTitle());
                    break;
                }
            }
        }
        floorMrPageResult.setData(data);
        return floorMrPageResult;
    }
}
*/
